<%@ page language="java" contentType="text/html; charset=utf-8" pageEncoding="utf-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@taglib prefix="sec" uri="/WEB-INF/shiro.tld"%>
<%@taglib prefix="pt6" uri="/WEB-INF/platform6.tld"%>
<%@ page import="avicit.platform6.commons.utils.ViewUtil"%>
<%
	String importlibs = "common,form";
%>
<!DOCTYPE html>
<html>
<head>
<!-- ControllerPath = "demo/oaTravelRb/oaTravelRbController/operation/Add/null" -->
<title>添加</title>
<base href="<%=ViewUtil.getRequestPath(request)%>">
<jsp:include page="/avicit/platform6/h5component/common/h5uiinclude-css.jsp">
<jsp:param value="<%=importlibs%>" name="importlibs"/>
</jsp:include>
</head>
<body class="easyui-layout" fit="true">
	<div data-options="region:'center',split:true,border:false">
		<form id='form'>
			<input type="hidden" name="id" />
			<table class="form_commonTable">
				<tr>
					<th width="15%">
						<label for="applyUserIdAlias">报销人:</label></th>
					<td width="34%">
						<div class="input-group  input-group-sm">
							<input type="hidden"  id="applyUserId" name="applyUserId">
							<input class="form-control" placeholder="请选择用户" type="text" id="applyUserIdAlias" name="applyUserIdAlias">
							<span class="input-group-addon">
								<i class="glyphicon glyphicon-user"></i>
							</span>
						</div>
   					</td>
					<th width="15%">
						<label for="applyDeptIdAlias">部门:</label></th>
					<td width="34%">
						<div class="input-group  input-group-sm">
							<input type="hidden"  id="applyDeptId" name="applyDeptId">
							<input class="form-control" placeholder="请选择部门" type="text" id="applyDeptIdAlias" name="applyDeptIdAlias" >
							<span class="input-group-addon">
							<i class="glyphicon glyphicon-equalizer"></i>
							</span>
						</div>
   					</td>
				</tr>
    			<tr>
					<th>
						<label for="applyPostId">职务:</label></th>
					<td>
						<input class="form-control input-sm" type="text" name="applyPostId"  id="applyPostId" />
   					</td>
					<th>
						<label for="rbType">出差类型:</label></th>
					<td>
						<input class="form-control input-sm" type="text" name="rbType"  id="rbType" />
   					</td>
				</tr>
    			<tr>
					<th>
						<label for="rbDays">出差总天数:</label></th>
					<td>
						<div class="input-group input-group-sm spinner" data-trigger="spinner">
							<input  class="form-control"  type="text" name="rbDays" id="rbDays" data-min="-99999999" data-max="99999999" data-step="1" data-precision="0">
							<span class="input-group-addon">
								<a href="javascript:;" class="spin-up" data-spin="up"><i class="glyphicon glyphicon-triangle-top"></i></a>
								<a href="javascript:;" class="spin-down" data-spin="down"><i class="glyphicon glyphicon-triangle-bottom"></i></a>
							</span>
						</div>
   					</td>
					<th>
						<label for="proCode">报销项目:</label></th>
					<td>
						<input class="form-control input-sm" type="text" name="proCode"  id="proCode" />
   					</td>
				</tr>
    			<tr>
					<th>
						<label for="proName">项目名称:</label></th>
					<td>
						<input class="form-control input-sm" type="text" name="proName"  id="proName" />
   					</td>
					<th>
						<label for="proManage">项目负责人:</label></th>
					<td>
						<input class="form-control input-sm" type="text" name="proManage"  id="proManage" />
   					</td>
				</tr>
    			<tr>
					<th>
						<label for="rbAmount">报销金额:</label></th>
					<td>
						<div class="input-group input-group-sm spinner" data-trigger="spinner">
							<input  class="form-control"  type="text" name="rbAmount" id="rbAmount" data-min="-99999999" data-max="99999999" data-step="1" data-precision="0">
							<span class="input-group-addon">
								<a href="javascript:;" class="spin-up" data-spin="up"><i class="glyphicon glyphicon-triangle-top"></i></a>
								<a href="javascript:;" class="spin-down" data-spin="down"><i class="glyphicon glyphicon-triangle-bottom"></i></a>
							</span>
						</div>
   					</td>
					<th>
						<label for="remarks">备注:</label></th>
					<td>
						<input class="form-control input-sm" type="text" name="remarks"  id="remarks" />
   					</td>
				</tr>
    			<tr>
					<th>
						<label for="secretLevel">项目密级:</label></th>
					<td>
						<pt6:h5select css_class="form-control input-sm" name="secretLevel" id="secretLevel" title="" isNull="true" lookupCode="PLATFORM_FILE_SECRET_LEVEL" />
   					</td>
				</tr>
			</table>
		</form>
	</div>
	<div data-options="region:'south',border:false" style="height: 50px;">
		<div id="toolbar"
			class="datagrid-toolbar datagrid-toolbar-extend foot-formopera">
			<table class="tableForm" style="border:0;cellspacing:1;width:100%">
				<tr>
					<td width="50%" style="padding-right:4%;" align="right">
						<a href="javascript:void(0)" class="btn btn-primary form-tool-btn typeb btn-sm" role="button" title="保存" id="oaTravelRb_saveForm">保存</a>
						<a href="javascript:void(0)" class="btn btn-grey form-tool-btn btn-sm" role="button" title="返回" id="oaTravelRb_closeForm">返回</a>
					</td>
				</tr>
			</table>
		</div>
	</div>
	<jsp:include page="/avicit/platform6/h5component/common/h5uiinclude-js.jsp">
	<jsp:param value="<%=importlibs%>" name="importlibs"/>
	</jsp:include>
	<script type="text/javascript" src="avic/demo/oatravelrb/js/h5-customselect.js"></script>
	<script type="text/javascript">
		//遮罩
		var maskId = null;
		//初始化时间控件
		function initDateSelect(){
			$('.date-picker').datepicker();
			$('.time-picker').datetimepicker({
				oneLine:true,//单行显示时分秒
				closeText:'确定',//关闭按钮文案
				showButtonPanel:true,//是否展示功能按钮面板
				showSecond:false,//是否可以选择秒，默认否
				beforeShow: function(selectedDate) {
					if($('#'+selectedDate.id).val()==""){
						$(this).datetimepicker("setDate", new Date());
						$('#'+selectedDate.id).val('');
					}
				}
			});
			$('.date-picker').on('keydown',nullInput);
			$('.time-picker').on('keydown',nullInput);
		}
	
		function closeForm(){
			parent.oaTravelRb.closeDialog("insert");
		}
		
		function saveForm(){
			var isValidate = $("#form").validate();
	        if (!isValidate.checkForm()) {
	            isValidate.showErrors();
	            return false;
	        }
	        //限制保存按钮多次点击
  		 	$('#oaTravelRb_saveForm').addClass('disabled').unbind("click");	
			parent.oaTravelRb.save($('#form'),"insert");
		}
		//清空日期值
		function clearCommonSelectValue(element) {
			$(element).siblings("input").val("");
		}
		$(document).ready(function () {
			initDateSelect();
			parent.oaTravelRb.formValidate($('#form'));
			//保存按钮绑定事件
			$('#oaTravelRb_saveForm').bind('click', function(){
				saveForm();
			}); 
			
			//返回按钮绑定事件
			$('#oaTravelRb_closeForm').bind('click', function(){
				closeForm();
			});
			
			$('#applyUserIdAlias').on('focus',function(e){
				new H5CommonSelect({type:'userSelect', idFiled:'applyUserId',textFiled:'applyUserIdAlias'});
				this.blur();
				nullInput(e);
			}); 
			$('#applyDeptIdAlias').on('focus',function(e){
				new H5CommonSelect({type:'deptSelect', idFiled:'applyDeptId',textFiled:'applyDeptIdAlias'});
				this.blur();
				nullInput(e);
			});

		    $('#proCode').bind('focus', function(){
		    	var fields={proCode:"proCode",proName:"proName",proManage:"proManage",secretLevel:"secretLevel"};
		    	$("#proCode").blur();
		    	//var url = "avic/demo/oatravelrb/OaTravelRbSelect.jsp";
				var url = "avic/demo/oatravelrb/PmProjectInfoSelect.jsp";
                showCustomDialog('请选择',url,"700px","400px",fields,"",null,true,true);
		    });

		});
	</script>
</body>
</html>

